package com.danskin.wechat.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.danskin.wechat.vo.CustCouponApiView;
import com.danskin.wechat.entity.CustCouponRecord;
import com.danskin.wechat.entity.example.CustCouponRecordExample;
import com.danskin.wechat.util.Page;

public interface CustCouponRecordDao {

	List<CustCouponApiView> listPageByOpenId(Page page);

	CustCouponApiView selectViewById(@Param("id") int id, @Param("appId") String appId);

	/**
	 * 根据ID查询对象
	 * 
	 * @param Id
	 * @return
	 */
	public CustCouponRecord selectByIdAndCouponNo(@Param("id") int id, @Param("couponNo") String couponNo);

	public CustCouponRecord selectByCustExIdAndCouponNo(@Param("custExId") int custExId, @Param("couponNo") String couponNo);
	/**
	public CustCouponRecord selectByIdAndCouponNo(@Param("id") int id, @Param("couponNo") String couponNo);
	 * 根据查询对象和分页条件，查询平台用户list
	 * 
	 * @param custCouponRecord
	 * @return
	 */
	public List<CustCouponRecord> selectCustCouponRecordPageList(
			@Param("custCouponRecord") CustCouponRecord custCouponRecord, @Param("offset") int offset,
			@Param("limit") int limit);
	

	public int insertSelective(CustCouponRecord custCouponRecord);

	public int updateByPrimaryKeySelective(CustCouponRecord custCouponRecord);
	/**
	 * 更新is_wx_get字段为1
	 * 
	 * @param custCouponRecord
	 */
	public int updateIsWxGetByCouponNo(CustCouponRecord custCouponRecord);


	/**
	 * 根据条件查询可用券数量
	 * @param custCouponRecord
	 * @return
	 */
	int selectAvaCouponByCondition(CustCouponRecord custCouponRecord);
	
	
	int countByExample(CustCouponRecordExample example);

    int deleteByExample(CustCouponRecordExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(CustCouponRecord record);


    List<CustCouponRecord> selectByExample(CustCouponRecordExample example);

    CustCouponRecord selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") CustCouponRecord record, @Param("example") CustCouponRecordExample example);

    int updateByExample(@Param("record") CustCouponRecord record, @Param("example") CustCouponRecordExample example);


    int updateByPrimaryKey(CustCouponRecord record);
	

}
